package com.atguigu.gmall.payment.service;

import com.atguigu.gmall.model.order.OrderInfo;
import com.atguigu.gmall.model.payment.PaymentInfo;

import java.util.Map;

public interface PaymentService {

    //  保存交易记录：
    void savePaymentInfo(OrderInfo orderInfo,String paymentType);

    /**
     * 根据outTradeNo,paymentType 查找paymentInfo
     * @param outTradeNo
     * @param paymentType
     * @return
     */
    PaymentInfo getPaymentInfo(String outTradeNo, String paymentType);

    /**
     * 修改交易记录的状态.
     * @param outTradeNo
     * @param paymentType
     * @param paramsMap
     */
    void updatePaymentInfoStatus(String outTradeNo, String paymentType, Map<String, String> paramsMap);

    /**
     * 修改交易记录状态。
     * @param paymentInfo
     * @param outTradeNo
     * @param paymentType
     */
    void updatePaymentStatus(PaymentInfo paymentInfo, String outTradeNo, String paymentType);

    /**
     * 关闭交易记录方法
     * @param orderId
     */
    void paymentClose(Long orderId);

}
